//
//  PriceTableViewCell.m
//  bitcoin
//
//  Created by  旺链 on 2018/6/1.
//  Copyright © 2018年 比特币. All rights reserved.
//

#import "PriceTableViewCell.h"

@implementation PriceTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)config:(NSDictionary*)data
{
    self.priceLb.text = data[@"price"];
    
    if ([data[@"amount"]isEqualToString:@""]) {
        self.countLb.text = data[@"amount"];
        return;
    }
    NSString *str = data[@"amount"];
    CGFloat count =[data[@"amount"]floatValue];
    
    if (count > 1000) {
        count = count/1000;
        str = [NSString stringWithFormat:@"%.4fK",count];
    }else{
        str = [NSString stringWithFormat:@"%.4f",count];
    }
    
    self.countLb.text = str;
}
@end
